<template>
    <div>
        <h2>TsCart</h2>

        {{ title }}--{{ name }}
        <button @click="title = 'hi cart'">setTitle</button>
        <button @click="updateName('lili')">updateName</button>
        <TsShop></TsShop>

    </div>
</template>
<script setup>
import { inject } from 'vue';
import TsShop from './TsShop.vue';
// 依赖注入
const title = inject('title')
const age = inject('age', 19)
const { name, updateName } = inject('name')

</script>